﻿using System;
using System.Linq;
using System.Collections.Generic;
using HashFoo.Core;

namespace HashFoo.SqlServer.Spatial
{
    /// <summary>
    /// Enumerates all the know SqlServer geometry types (for both SqlGeometry and SqlGeography)
    /// </summary>
    public class GeometryType : SymbolEnumeration<GeometryType>
    {
        /// <summary>
        /// A generic geometry type.
        /// </summary>
        public static readonly GeometryType Geometry = new GeometryType("Geometry");

        /// <summary>
        /// A single point geometry type.
        /// </summary>
        public static readonly GeometryType Point = new GeometryType("Point");

        /// <summary>
        /// A line string geometry type (a series of connected points, not closed).
        /// </summary>
        public static readonly GeometryType LineString = new GeometryType("LineString");

        /// <summary>
        /// A polygon geometry type.
        /// </summary>
        public static readonly GeometryType Polygon = new GeometryType("Polygon");

        /// <summary>
        /// A curve geometry type.  Not sure -- use google to get the definition.
        /// </summary>
        public static readonly GeometryType Curve = new GeometryType("Curve");

        /// <summary>
        /// A surface geometry type.  Not sure -- use google.
        /// </summary>
        public static readonly GeometryType Surface = new GeometryType("Surface");

        /// <summary>
        /// A multipoint geometry type -- a collection of point geometries.
        /// </summary>
        public static readonly GeometryType MultiPoint = new GeometryType("MultiPoint");

        /// <summary>
        /// A multi-linestring geometry type -- a collection of line strings.
        /// </summary>
        public static readonly GeometryType MultiLineString = new GeometryType("MultiLineString");

        /// <summary>
        /// A multi-polygon geometry type -- a collection of polygons.
        /// </summary>
        public static readonly GeometryType MultiPolygon = new GeometryType("MultiPolygon");

        /// <summary>
        /// A multi-curve geometry type -- a collection of curves.
        /// </summary>
        public static readonly GeometryType MultiCurve = new GeometryType("MultiCurve");

        /// <summary>
        /// A multi-surface geometry type -- a collection of surfaces.
        /// </summary>
        public static readonly GeometryType MultiSurface = new GeometryType("MultiSurface");

        /// <summary>
        /// A gereric geometry collection type.
        /// </summary>
        public static readonly GeometryType GeometryCollection = new GeometryType("GeometryCollection");

        /// <summary>
        /// Create a geometry type with the same symbol and display value.
        /// </summary>
        /// <param name="symbolValue"></param>
        GeometryType(string symbolValue) 
            :this(symbolValue, symbolValue) { }

        /// <summary>
        /// Create a new <see cref="GeometryType"/>
        /// </summary>
        /// <param name="symbolValue"></param>
        /// <param name="displayName"></param>
        protected GeometryType(string symbolValue, string displayName)
            : base(symbolValue, displayName) {}
    }
}